import { crateApplyTemplate,findApplyTemplate,updateApplyTemplate,deleteApplyTemplate } from '@/api/applyTemplateManager'

const applyTemplateManager = {
    actions: {
        // 创建
        CrateApplyTemplate({commit},data) {
            return new Promise((resolve, reject) => {
                crateApplyTemplate(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },
        //搜索
        FindApplyTemplate({commit},data){
            return new Promise((resolve, reject) => {
                findApplyTemplate(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },
        // 修改
        UpdateApplyTemplate({commit},data) {
            return new Promise((resolve, reject) => {
                updateApplyTemplate(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },
        // 删除
        DeleteApplyTemplate({commit},data) {
            return new Promise((resolve, reject) => {
                deleteApplyTemplate(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },
    }
}

export default applyTemplateManager
